import request from '../utils/request'

/**
 * 获取所有频道列表数据
 * @returns
 */
export function getAllChannelApi () {
  return request({ url: 'channels' })
}

/**
 * 获取用户频道列表数据
 * @returns
 */
export function getUserChannelApi () {
  return request({ url: 'user/channels' })
}

/**
 * 删除用户频道
 * @returns
 */
export function delUserChannelApi (channelId) {
  return request.delete(`user/channels/${channelId}`)
}

/**
 * 添加频道
 * @param {*} newChannel 新的频道数据
 */
export function addChannelApi (newChannel) {
  return request.put('user/channels', {
    channels: newChannel
  })
}
